home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_gen_sendmessage.cog < prev    next >
Text File  |  1999-11-15  |  1KB  |  64 lines

  1. # Jones 3D Cog Script
  2. #
  3. # gen_SendMessage.cog
  4. #
  5. # Send Activated message to another cog when chosen sectors, faces, or things are Entered
  6. # Set flex "onetime" to 1 for one-time-only use, otherwise set it to 0
  7. # Disclaimer: Activate message on recipient cog should have code to handle multiple activations!
  8. # Disclaimer #2: May not work with some scripts due to GetSenderID checks! (works OK with 00elevswitch)
  9. #
  10. # [YB]
  11. #
  12. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  13. # ========================================================================================
  14.  
  15. symbols
  16.     message    entered
  17.     message    timer
  18.  
  19.     surface    surface1
  20.     surface    surface2
  21.  
  22.     sector    sector1
  23.     sector    sector2
  24.  
  25.     thing        thing1
  26.     thing        thing2
  27.  
  28.     cog        recipient
  29.  
  30.     flex        onetime=0        // multiple instances by default
  31.     flex        messagedelay=0
  32.  
  33. # subroutines
  34.     flex    sendit=0.0    local
  35. end
  36.  
  37. code
  38. # ........................................................................................
  39.  
  40. entered:
  41.     if (onetime == 2) return;
  42.     SetTimer(messagedelay + .01);
  43.     return;
  44.  
  45. # ........................................................................................
  46.  
  47. sendit:
  48.     if (onetime == 1)
  49.     {
  50.         onetime = 2;
  51.     }
  52.  
  53.     SendMessage(recipient, activate);
  54.     return;
  55.  
  56. # ........................................................................................
  57.  
  58. timer:
  59.     call sendit;
  60.     return;
  61.     
  62. end
  63.  
  64.